/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  CCell, Cell, Table, TableBody, TableRow, Text,
} from "customize-easy-ui-component";
import {DirectLink} from "../../routing/Link";
import Img_Seal from "../../images/seal.png";
import {CCellUnit} from "../common/base";


//年度检查的
export const 检验结论VsNj= ({theme, orc, rep} :{theme: any, orc:any, rep:any}
) => {
  return <><Table  fixed={ ["11%","21%","9%","%"] } css={ {borderCollapse: 'collapse' } } tight  miniw={800}>
    <TableBody>
      <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion#Conclusion`}>
        <TableRow  css={{
          "@media print": {
            pageBreakInside: 'avoid',
          }
        }}>
          <CCell  scope="row" rowSpan={3}>检验结论</CCell>
          <CCell  scope="row" rowSpan={2}><Text variant="h4">{orc.检验结论}</Text></CCell>
          <CCell colSpan={2}>允许（监控）使用参数</CCell>
        </TableRow>
        <TableRow>
          <CCell colSpan={2} css={{padding:0}}>
            <Table  fixed={ ["22%","%"]  } css={ {borderCollapse: 'collapse', height:'fill-available'} } tight  miniw={800}>
              <TableBody>
                <TableRow >
                  <CCell>压力</CCell>
                  <CCellUnit unit={'MPa'}>{orc.结论压力 || '／'}</CCellUnit>
                </TableRow>
                <TableRow >
                  <CCell>温度</CCell>
                  <CCellUnit unit={'℃'}>{orc.结论温度 || '／'}</CCellUnit>
                </TableRow>
                <TableRow >
                  <CCell>介质</CCell>
                  <CCell>{orc.结论介质}</CCell>
                </TableRow>
              </TableBody>
            </Table>
          </CCell>
        </TableRow>
        <TableRow>
          <CCell>下次年度检验日期</CCell>
          <CCell colSpan={2}>{orc.新下检日}</CCell>
        </TableRow>
        <TableRow>
          <CCell  scope="row">说明</CCell>
          <Cell split={true} colSpan={3}><div css={{minHeight: '5rem', whiteSpace: 'pre-wrap'}}>
            {orc.结论说明 || '／'}
          </div></Cell>
        </TableRow>
      </DirectLink>
    </TableBody>
  </Table>
    <Table fixed={ ["4.2%","55%","4%","12%","%"]  }  css={ {borderCollapse: 'collapse' } }>
      <TableBody>
        <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion`}>
          <TableRow>
            <CCell>检查</CCell>
            <CCell>{orc.检验人IDs}</CCell>
            <CCell>日期</CCell>
            <CCell>{orc.检验日期 || '／'}</CCell>
            <CCell rowSpan={3}>
              <div css={{
                height:'8rem',
                '::before': {
                  filter: 'opacity(30%)',
                  width: '100%',
                  height: '100%',
                  backgroundImage: `url(${Img_Seal})`,
                  content: '" "',
                  position: 'absolute',
                  top: 0,
                  left: 0,
                  backgroundRepeat: 'no-repeat',
                  backgroundPosition: 'center',
                }
              }}>
                <Table  fixed={ ["40%","%"]  }
                        printColWidth={ ["105","156"] }
                        css={ {borderCollapse: 'collapse',height:'fill-available'} }
                >
                  <TableBody>
                    <TableRow>
                      <CCell css={{border:'none'}}>检验机构核准证号</CCell><CCell css={{border:'none'}}>{rep?.isp?.ispu?.agency?.apno}</CCell>
                    </TableRow>
                    <TableRow>
                      <CCell css={{border:'none'}} colSpan={2}>（检查单位检查专用章或者公章）</CCell>
                    </TableRow>
                    <TableRow>
                      <CCell css={{border:'none'}}>日期：</CCell>
                      <Cell css={{border:'none'}}>2024/03/04</Cell>
                    </TableRow>
                  </TableBody>
                </Table>
              </div>
            </CCell>
          </TableRow>
        </DirectLink>
        <TableRow>
          <CCell>审核</CCell>
          <CCell></CCell>
          <CCell>日期</CCell>
          <CCell></CCell>
        </TableRow>
        <TableRow >
          <CCell>批准</CCell>
          <CCell></CCell>
          <CCell>日期</CCell>
          <CCell></CCell>
        </TableRow>
      </TableBody>
    </Table>
  </>;
};

